const path = require('path'),
	{ readApk } = require('lib/utils'),
	uploadService = require('service/upload'),
	errors = require('error');


/**
 * 本地上传
 * @param {Function} next          [description]
 * @yield {[type]}   [description]
 */
function* upload(next) {
	let { file } = yield uploadService.upload.call(this, 'file');
	if (!file) errors.throwLackParameters();
	this.body = this.success(file);
	return yield next;
}

module.exports = {
	upload
}